<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
/*var re = /abc/;
var s1 = "abcabc";
var s2 = "aaabc";
console.log(re.test(s1));
console.log(re.lastIndex);
console.log(re.test(s2));*/

var re1 = /abc/g;
var re2 = /abc/g;
var s = "abc";
console.log(re1.test(s));
console.log(re2.test(s));
</script>
</body>
</html>